import { defHttp } from '/@/utils/http/axios';
import { GlobalCnfgParams } from '/@/api/sys/model/globalCnfgModel';

export enum Api {
  GetCustomerByPage = '/plm/customer/getCustomerByPage',
  SaveCustomer = '/plm/customer/saveCustomer',
  UpdateCustomer = '/plm/customer/updateCustomer',
  DeletePlmCustomer = '/plm/customer/deleteCustomer',
  ImportProductExcel = '/plm/customer/importProductExcel',
  ExportList = '/plm/customer/exportList',
}
/**
 * @description:  全局配置接口
 */
export const getCustomerByPage = (params: GlobalCnfgParams) =>
  defHttp.post({ url: Api.GetCustomerByPage, params });
export const saveCustomer = (params) => defHttp.post({ url: Api.SaveCustomer, params });
export const updateCustomer = (params) => defHttp.post({ url: Api.UpdateCustomer, params });
export const deleteCustomer = (params) => defHttp.post({ url: Api.DeletePlmCustomer, params });
export const importProductExcel = (params) => defHttp.post({ url: Api.ImportProductExcel, params });
export const exportList = (params?) =>
  defHttp.post(
    { url: Api.ExportList, params, responseType: 'blob' },
    { isReturnNativeResponse: true, isTransformResponse: false },
  );
